﻿namespace CSharpPro._10月27作业;

public class Demo
{
    private int id;//feild 字段
    private string name;
    private int age;

    //property 属性
    public int Id
    {
        get => id;
        //get { return id; }
        set => id = value;
        //set(value){this.Id=value;}
    }

    public string Name
    {
        get => name;
        set => name = value ?? throw new ArgumentNullException(nameof(value));
    }

    public int Age
    {
        get => age;
        set => age = value;
    }
    public void TestPrint()
    {
        Parent parent = new Parent();
        Child child = new Child();
        
        int result = Add(10, 20);
        Console.WriteLine(result);
        int int32 = Convert.ToInt32("123");
    }

    //overload
    public int Add(int a, int b)
    {
        return a + b;
    }

    public string Add(string a, string b)
    {
        return a + b;
    }
}


